RHOAIENG-57401: fix fragile if/elif chain in Cluster.status()#1038
Conversation
Refactor mixed if/elif chain to a proper if/elif/elif chain so that only one branch executes per call. Add missing SUSPENDED status test case. Resolves: RHOAIENG-54701 Made-with: Cursor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1038 +/- ##
==========================================
+ Coverage 96.15% 96.24% +0.08%
==========================================
Files 23 23
Lines 2238 2238
==========================================
+ Hits 2152 2154 +2
+ Misses 86 84 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2b7d778 to
0458bc3
Compare
|
@chipspeak: No Jira issue with key RHOAIENG-57401 exists in the tracker at https://redhat.atlassian.net. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/lgtm Refactor looks correct — READY now leads the chain and SUSPENDED/UNKNOWN are proper |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: laurafitzgerald The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9c686c9
into
project-codeflare:main
Summary
if/elifchain inCluster.status()(lines 354-368) into a properif/elif/elif/elifchain so that only one branch executes per call, eliminating redundant evaluations and preventing latent bugs from future edits.RayClusterStatus.SUSPENDEDintest_cluster_status.Test plan
test_cluster_statustests pass (UNKNOWN, FAILED, UNHEALTHY, READY)blackformatting check passesResolves: RHOAIENG-54701
Made with Cursor